<?php
require 'inc_security.php';
                       
$list = new dataGrid('spo_id',30);
$list->add('','Thông tin','string',0,0);

$list->add('','Active','string');
$list->add('','Delete','delete');
$db_count = new db_count('SELECT count(*) as count 
                            FROM '.$bg_table.'
                            WHERE 1 '.$list->sqlSearch().'
                            ');
$total = $db_count->total;unset($db_count);

$db_listing = new db_query('SELECT * 
                            FROM '.$bg_table.'
                            WHERE 1 '.$list->sqlSearch().'
                            ORDER BY '.$list->sqlSort().' spo_id DESC
                            '.$list->limit($total));
$total_row = mysql_num_rows($db_listing->result);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?=$load_header?>
<style>
label{
   width: 100px;
   float: left;
   text-align: right;
   padding-right: 20px;
}
</style>
</head>
<body>
<div class="module_header bold fix"><?=$module_name?></div>
<div id="wrapper">
    <?=$list->showHeader($total_row)?>
    <?php
    $i = 0; 
    ?>
    <?php while($row = mysql_fetch_assoc($db_listing->result)){
        $i++;
    ?>
    <?=$list->start_tr($i,$row[$id_field])?>
    <td>
       <label>Tên công ty </label><?=form_input('spo_company_name'.$row[$id_field],$row['spo_company_name'],'class="span6" onkeyup="check_edit(\'record_'.$i.'\')"')?><br /><br />
       <label>Địa chỉ </label><?=form_input('spo_company_address'.$row[$id_field],$row['spo_company_address'],'class="span6" onkeyup="check_edit(\'record_'.$i.'\')"')?><br /><br />
       <label>Yahoo </label><?=form_input('spo_yahoo'.$row[$id_field],$row['spo_yahoo'],'class="span2" onkeyup="check_edit(\'record_'.$i.'\')"')?><br /><br />
       <label>Skype </label><?=form_input('spo_skype'.$row[$id_field],$row['spo_skype'],'class="span2" onkeyup="check_edit(\'record_'.$i.'\')"')?><br /><br />
       <label>Tư vấn bán hàng </label><?=form_input('spo_consulting_phone'.$row[$id_field],$row['spo_consulting_phone'],'class="span2" onkeyup="check_edit(\'record_'.$i.'\')"')?><br /><br />
       <label>Hotline </label><?=form_input('spo_hotline'.$row[$id_field],$row['spo_hotline'],'class="span2" onkeyup="check_edit(\'record_'.$i.'\')"')?><br /><br />
       <label>FAX </label><?=form_input('spo_fax'.$row[$id_field],$row['spo_fax'],'class="span2" onkeyup="check_edit(\'record_'.$i.'\')"')?><br /><br />
       <label>Email </label><?=form_input('spo_email'.$row[$id_field],$row['spo_email'],'class="span6" onkeyup="check_edit(\'record_'.$i.'\')"')?> 
    </td>
    <?=$list->showCheckbox('spo_active',$row['spo_active'],$row[$id_field])?>
    <?=$list->showDelete($row[$id_field])?>
    <?=$list->end_tr()?>
    <?}?>
    <?=$list->showFooter()?>
</div>
</body>
</html>